package com.example.activemq;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

@Component
public class Consumer {
	//containerFactory从JmsConfig中来
	@JmsListener(destination = "sample.queue",containerFactory = "queueListenerFactory")
	 @SendTo("return.queue")
	public String receiveMessge(String text){
		System.out.println("第一个消费者接收quene");
		System.out.println("接收的消息内容:\t" + text);
		//接收消息并把结果返回给生产者
		return "处理完毕";
	}
	
	
}